home *** CD-ROM | disk | FTP | other *** search
/ Univers Interactif 3 / INTERACTIF.BIN / pc / planeten / internet / bookmark.sit / Bookmark Sorter© / background_2742.txt < prev    next >
Text File  |  1995-03-15  |  3KB  |  129 lines

  1. -- background: 2742 from stack: in
  2. -- bmap block id: 0
  3. -- flags: 0000
  4. -- background id: 0
  5. -- name: 
  6.  
  7.  
  8. -- part 3 (field)
  9. -- low flags: 84
  10. -- high flags: 0000
  11. -- rect: left=28 top=13 right=98 bottom=228
  12. -- title width / last selected line: 0
  13. -- icon id / first selected line: 0 / 0
  14. -- text alignment: 0
  15. -- font id: 3
  16. -- text size: 12
  17. -- style flags: 0
  18. -- line height: 16
  19. -- part name: temp
  20.  
  21.  
  22. -- part 2 (field)
  23. -- low flags: 05
  24. -- high flags: 0000
  25. -- rect: left=0 top=113 right=128 bottom=256
  26. -- title width / last selected line: 0
  27. -- icon id / first selected line: 0 / 0
  28. -- text alignment: 1
  29. -- font id: 20
  30. -- text size: 10
  31. -- style flags: 0
  32. -- line height: 13
  33. -- part name: copyright
  34.  
  35.  
  36. -- part 4 (field)
  37. -- low flags: 84
  38. -- high flags: 0007
  39. -- rect: left=28 top=24 right=109 bottom=228
  40. -- title width / last selected line: 0
  41. -- icon id / first selected line: 0 / 0
  42. -- text alignment: 0
  43. -- font id: 3
  44. -- text size: 12
  45. -- style flags: 0
  46. -- line height: 16
  47. -- part name: temp2
  48.  
  49.  
  50. -- part 1 (button)
  51. -- low flags: 00
  52. -- high flags: A003
  53. -- rect: left=78 top=33 right=55 bottom=178
  54. -- title width / last selected line: 0
  55. -- icon id / first selected line: 0 / 0
  56. -- text alignment: 1
  57. -- font id: 16383
  58. -- text size: 12
  59. -- style flags: 0
  60. -- line height: 16
  61. -- part name: Sort It!
  62. ----- HyperTalk script -----
  63. on mouseUp
  64.   do srtList
  65. end mouseUp
  66.  
  67. on srtList
  68.   put empty into bg field "temp"
  69.   put empty into bg field "temp2"
  70.   answer file "Choose a Bookmark file to sort." of type "TEXT"
  71.   put the result into resultCode -- if you cancel
  72.   if resultCode is empty -- everything's fine
  73.   then put it into bookmark -- then put the path into bookmark variable
  74. else exit srtList
  75. ask file "Give the sorted file a name." with "Sorted (" & the date & ")"
  76. put the result into resultCode -- if you cancel
  77. if resultCode is empty -- everything's fine
  78. then put it into sorted -- then put the path into sorted variable
  79. else exit srtList
  80. open file bookmark
  81. read from file bookmark until end
  82. put it into bg field "temp"
  83. do theWork
  84. open file sorted
  85. write bg field "temp" to file sorted
  86. close file bookmark
  87. close file sorted
  88. beep 3
  89. end srtList
  90.  
  91. on theWork
  92.   put 1 into lCount
  93.   repeat
  94.     set cursor to busy
  95.     find string "<A HREF" in bg field "temp"
  96.     if the result is not empty then exit repeat
  97.     put the foundChunk into tempFound1
  98.     find string "</A>" in bg field "temp"
  99.     if the result is not empty then exit repeat
  100.     put the foundChunk into tempFound2
  101.     put word 2 of tempFound1 into charNum
  102.     put word 4 of tempFound2 into charNum2
  103.     put char charNum to charNum2 of bg field "temp" into line lCount of bg field "temp2"
  104.     delete char charNum to charNum2 of bg field "temp"
  105.     add 1 to lCount
  106.   end repeat
  107.   put 1 into lCount
  108.   put empty into bg field "temp"
  109.   repeat
  110.     set cursor to busy
  111.     find string "ADD_DATE=" in bg field "temp2"
  112.     if the result is not empty then exit repeat
  113.     put the foundChunk into tempFound1
  114.     put the foundLine into tempLine
  115.     find string quote & ">" in bg field "temp2"
  116.     if the result is not empty then exit repeat
  117.     put the foundChunk into tempFound2
  118.     put word 2 of tempFound1 into charNum
  119.     put word 4 of tempFound2 into charNum2
  120.     subtract 1 from charNum2
  121.     delete char charNum to charNum2 of bg field "temp2"
  122.     put word 2 of tempLine into LineNum
  123.     put line lineNum of bg field "temp2" into line lCount of bg field "temp"
  124.     add 1 to lCount
  125.   end repeat
  126.   sort lines of bg field "temp" by word 3 of each
  127. end theWork
  128.  
  129.